package com.example.makerspace.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.makerspace.domain.UserFormsDO;
import com.example.makerspace.mapper.SingInDataMapper;
import com.example.makerspace.mapper.UserFormsMapper;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.List;

@Component
public class UserFormsDAO extends  BaseDAO<UserFormsDO> {
    @Resource
    private UserFormsMapper userFormsMapper;
    @PostConstruct
    public void init(){
        this.mapper = userFormsMapper;
    }

    public List<UserFormsDO> selectByUserName(String username) {
        QueryWrapper<UserFormsDO> wrapper = new QueryWrapper<>();
        wrapper.eq("username",username);
        return  mapper.selectList(wrapper);
    }

    public List<UserFormsDO> selectByHavaWirte() {
        QueryWrapper<UserFormsDO> wrapper = new QueryWrapper<>();
        wrapper.eq("is_fill",1);
        return  mapper.selectList(wrapper);

    }
}
